package com.geeka.d08;

public class TestCustomException {
    public static void main(String[] args) {
        login("Tom","1234");
    }

    public static void login(String uname,String pass)  {
        //模拟登录
        if(uname.equals("admin") && pass.equals("123")){
            System.out.println("登录成功 ");
        }else{
//            System.out.println("登录失败");
           throw new LoginException("登录失败");
        }
    }
}
